from django.db import models
from utils.modelsMixin import ModelSetMixin
from django.contrib.auth.models import User


# Create your models here.
class Classes(ModelSetMixin):
    name = models.CharField(max_length=20, verbose_name='班级名称', help_text='班级名称')
    num = models.CharField('班期', max_length=20, help_text='班期')

    member = models.ManyToManyField(User)  # 关联字段 某个老师或者学生可能在不同的班里，不同的班里可能有多个老师或者学生

    class Meta:
        db_table = 'Classes'
        verbose_name = '班级'
        verbose_name_plural = verbose_name  # 考虑到英文中的复数形式，所以需要对此优化一下

    def __str__(self):
        return f'{self.name}-{self.num}'